*****Statistical analysis in the manuscript and online supplementary document

gen error=abs( point_estimate - true_death )
gen log_nerror=log(error/population)
egen location_id=group(location)
egen week_id=group(week)

gen forecast_length=substr( target ,1,2)
destring forecast_length,replace

gen combo= location+" "+week

egen combo_id=group(combo)

xtset combo_id


gen ensemble=1 if model_group =="ensemble"
replace ensemble=0 if ensemble==.
gen datadriven=1 if model_group=="data"
replace datadriven=0 if datadriven==.
gen stateresetting=1 if model_group=="state-resetting"
replace stateresetting=0 if stateresetting==.
gen mechanistic=1 if model_group=="mechanistic"
replace mechanistic=0 if mechanistic==.

 forvalues i = 1/7 {
xtreg log_nerror ensemble datadriven stateresetting Academia##Modeldocumentation if log_nerror>=-15.89 & log_nerror<=-9.07 &  model_group!="other" & model_group!="" & forecast_length==`i',fe
outreg2 using doc1.doc, alpha(0.001, 0.01, 0.05) append ctitle(Week `i')
}

 forvalues i = 8/14 {
xtreg log_nerror ensemble datadriven stateresetting Academi##Modeldocumentation if log_nerror>=-15.89 & log_nerror<=-9.07 &  model_group!="other" & model_group!="" & forecast_length==`i',fe
outreg2 using doc2.doc, alpha(0.001, 0.01, 0.05) append ctitle(Week `i')
}

 forvalues i = 1/7 {
xtreg log_nerror ensemble datadriven stateresetting mechanistic if log_nerror>=-15.89 & log_nerror<=-9.07 &  model_group!="other" & model_group!="" & forecast_length==`i',fe
outreg2 using constant1.doc, alpha(0.001, 0.01, 0.05) append ctitle(Week `i')
}

 forvalues i = 8/14 {
xtreg log_nerror ensemble datadriven stateresetting mechanistic if log_nerror>=-15.89 & log_nerror<=-9.07 &  model_group!="other" & model_group!="" & forecast_length==`i',fe
outreg2 using constant2.doc, alpha(0.001, 0.01, 0.05) append ctitle(Week `i')
}

